home *** CD-ROM | disk | FTP | other *** search
- <xsl:stylesheet version='1.0'
- xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
- xmlns:msxsl="urn:schemas-microsoft-com:xslt"
- >
-
- <xsl:output method="text"/>
-
- <xsl:template match="/">
- <xsl:text>'Paris'</xsl:text>
-
- <xsl:text> is</xsl:text>
- <xsl:call-template name="stringCompare">
- <xsl:with-param name="str1" select="'Paris'"/>
- <xsl:with-param name="str2" select="'London'"/>
- </xsl:call-template>
- <xsl:text>'London'</xsl:text>
- </xsl:template>
-
- <xsl:template name="stringCompare">
- <xsl:param name="str1"/>
- <xsl:param name="str2"/>
-
- <xsl:choose>
- <xsl:when test="str1=str2">
- <xsl:text> equal </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="thePair">
- <xsl:element name="str1">
- <xsl:value-of select="$str1"/>
- </xsl:element>
- <xsl:element name="str2">
- <xsl:value-of select="$str2"/>
- </xsl:element>
- </xsl:variable>
- <xsl:variable name="sortedPair">
- <xsl:for-each select="msxsl:node-set($thePair)/*">
- <xsl:sort select="."/>
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$str1 = msxsl:node-set($sortedPair)/*[1]">
- <xsl:text> less than </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> greater than </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
- </xsl:stylesheet>
-
-
-
-
-